﻿using System.Text;
using System.Collections.Generic;
using FarseerGames.FarseerPhysics;
using FarseerGames.FarseerPhysics.Collisions;
using FarseerGames.FarseerPhysics.Dynamics.Springs;
using FarseerGames.FarseerPhysics.Factories;
using PhysicsObjects;
using PrototypeGame.ScreenSystem;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Content;
using UnitLibrary.Managers;
using UnitLibrary.GameObjects.Physics; using UnitLibrary.GameObjects.Units;
using UnitLibrary.Utility;

namespace PrototypeGame.GameScreens
{
    public class Survival: MainGameScreen
    {
        
        public Survival(Game game)
            : base(game)
        {
            _gameLevel = 1;
        }

        private PointsM _killPointsManager;

        /// <summary>
        /// 
        /// </summary>
        public override void Initialize()
        {           
            base.Initialize();
        }

        public override void LoadContent()
        {       
            
            base.LoadContent();
        }

        public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen)
        {
            GameLoseConditions();
            base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen);
        }

        /// <summary>
        /// Conditions for a lose
        /// </summary>
        public void GameLoseConditions()
        {
            if (_gameComponents.playerManager.Player.Health < 0)
                EndGame(GameState.PlayerDied);
        }

        /// <summary>
        /// Get the level title
        /// </summary>
        /// <returns></returns>
        public static string GetLevelTitle()
        {
            return "Survive as long as possible!";
        }        

        public static string GetLevelDetails()
        {
            StringBuilder sb = new StringBuilder();
            sb.AppendLine("Don't die!");
            return sb.ToString();
        }
    }
}
